all: bootLoader
	dd if=/dev/zero 	of=../smart-os.img count=10080
	dd if=bootLoader 	of=../smart-os.img conv=notrunc

bootLoader: bootAsm.o bootMain.o myPrintfDebug.o
	ld -N -e start -Ttext 0x7C00 -o bootLoader.o bootAsm.o bootMain.o myPrintfDebug.o
	objdump -S bootLoader.o > bootLoader.s
	objcopy -S -O binary bootLoader.o bootLoader
	./sign.pl bootLoader

bootAsm.o: bootAsm.s
	gcc -c -nostdinc -pedantic -Wall -O2 bootAsm.s

bootMain.o: bootMain.c
	gcc -c -std=c99 -nostdinc -pedantic -Wall -O2 -I. bootMain.c

myPrintfDebug.o: myPrintfDebug.s
	gcc -c -O2 -nostdinc myPrintfDebug.s

clean:
	rm -rf bootLoader
	rm -rf *.o
